#!/usr/bin/perl

open TAGS, "flickr_most_popular_tags" or die;
while (<TAGS>) {
	chomp;
	$path = "thumbnails/$_";
    system("mkdir $path");
    $file = "thumbnail_urls/$_";
    open URLS, $file or die "can't open $file";
    $cnt = 1;
    while (<URLS>) {
    	chomp;
        system("wget $_ -O $path/$cnt");       
        ++$cnt;
    }
}

